<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            position: relative;
            width: 500px;
            height: 500px;
            border: 1px solid black;
            float:left;
            margin-left: 200px;
        }
        .box2{
            position: relative;
            width: 500px;
            height: 500px;
            border: 1px solid black;
            float: right;
            margin-right: 200px;
        }
        .innerBox1{
            position: absolute;
            top: 100px;
            left: 50%;
            width: 200px;
            height: 200px;
            border: 1px solid blue;
            background-color: blue;
            margin-left: -100px;
        }
        .innerBox2{
            position: absolute;
            width: 200px;
            left: 50%;
            height: 200px;
            border: 1px solid red;
            background-color: red;
            transform: translate(-50%);
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="innerBox1"></div>
    </div>
    <div class="box2">
        <div class="innerBox2"></div>
    </div>
    
</body>
</html>